Desktop applications such as messaging applications, media applications, social networking applications or others generally present users with an active display of content. A social networking application for example may present a user with a view of other users who are currently active. The list of active users can be retrieved from an online data service. The online data service typically retrieves contact lists or other information from a structured database, often hosted by a SQL (structured query language) server.
However, existing methods for providing the user with a representation of data or services delivered from a remote database involve drawbacks. For one, the programming interface between the application and server is not typically based on a general query protocol, but is instead hardwired between the application and server. Portability and extensibility of applications is therefore limited. For another, because updates to the data or service are queried from a SQL server, a new search transaction may be required to generate each refreshed view of the content. Polling with repeated queries involves an inherent tradeoff between the bandwidth and processing demands and the responsiveness that can be provided to the user. This tradeoff can make it difficult to dynamically maintain the user's displayed contact list, media list, or other information in real-time.
It has been known to implement online data services with a query cache, where a query against a SQL or other database is recorded and the results stored for future use. For example, the last 100 user queries can be cached by a SQL server. The results of those queries can be saved and served when the same query is later presented by the same or a different user.
Query-based caching also involves drawbacks, however. To provide an effective caching and achieve a high cache hit rate, the cached queries must be large-scale and cover a large amount of data; this means that clients will frequently receive more data than desired. In a social networking service, the cached data might include all of a user's contacts, when the application only wants information about currently active users. In addition, caching queries in the server can only reduce processing demands in the server; the bandwidth used between the client and, the server will be the same as if no caching is used. Finally caching queries in the server still involves a tradeoff between processing demands and responsiveness: as long as a cached result is used, no new data will be seen by the user. In order to see new data, the query must be re-executed.
It may be desirable to provide methods and systems for online query processing and data encapsulation that provide greater processing efficiency and flexibility.